class AuspiciousTimeListModel {
  bool? success;
  int? code;
  String? message;
  DailyDataModel? data;

  AuspiciousTimeListModel({
    this.success,
    this.code,
    this.message,
    this.data,
  });

  AuspiciousTimeListModel.fromJson(Map<String, dynamic> json) {
    success = json['success'];
    code = json['code'];
    message = json['message'];
    data = json['data'] != null ? DailyDataModel.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['success'] = success;
    data['code'] = code;
    data['message'] = message;
    if (this.data != null) {
      data['data'] = this.data!.toJson();
    }
    return data;
  }
}

class DailyDataModel {
  String? time;

  DailyDataModel({
    this.time,
  });

  DailyDataModel.fromJson(Map<String, dynamic> json) {
    time = json['time'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['time'] = time;
    return data;
  }
}

class AuspiciousTimeHtmlModel {
  String? day;
  Map<int, HourlyHoroscope>? html;

  AuspiciousTimeHtmlModel({this.day, this.html});

  AuspiciousTimeHtmlModel.fromJson(Map<String, dynamic> json) {
    day = json['day'];
    if (json['html'] != null) {
      html = (json['html'] as Map<String, dynamic>).map(
            (key, value) => MapEntry(int.parse(key), HourlyHoroscope.fromJson(value)),
      );
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = {};
    data['day'] = day;
    if (html != null) {
      data['html'] = html!.map((key, value) => MapEntry(key.toString(), value.toJson()));
    }
    return data;
  }
}

class HourlyHoroscope {
  String? timeConflict; // 时辰冲突信息
  List<String>? suitableActivities; // 宜
  List<String>? unsuitableActivities; // 忌

  HourlyHoroscope({this.timeConflict, this.suitableActivities, this.unsuitableActivities});

  HourlyHoroscope.fromJson(Map<String, dynamic> json) {
    timeConflict = json['t'];
    suitableActivities = json['y'] != null ? List<String>.from(json['y']) : null;
    unsuitableActivities = json['j'] != null ? List<String>.from(json['j']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = {};
    data['t'] = timeConflict;
    data['y'] = suitableActivities;
    data['j'] = unsuitableActivities;
    return data;
  }
}
